package com.zjm.structural.composite.university;

/**
 * 组合模式测试
 */
public class Client {
    public static void main(String[] args) {
        OrganizationComponent university = new University("清华大学", "大学");

        OrganizationComponent collage1 = new Collage("计算机学院", "学院");
        OrganizationComponent collage2 = new Collage("美术学院", "学院");
        OrganizationComponent collage3 = new Collage("数学学院", "学院");

        collage1.add(new Department("计算机科学与技术", "专业"));
        collage1.add(new Department("软件工程", "专业"));

        collage2.add(new Department("美术", "专业"));

        collage3.add(new Department("数学", "专业"));

        // 学院加入学校
        university.add(collage1);
        university.add(collage2);
        university.add(collage3);

        university.print();
    }
}
